<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
</head>
<body>

</body>
</html>
<script>
   function Person(name,age) {   //  构造函数
       this.name = name;   // 只写属性
       this.age = age;
   }
    Person.prototype.showName = function() {  // 用的共同的父亲
        alert("我的名字是"+ this.name);
    }
    Person.prototype.showAge = function() {
        alert("我的名字是"+ this.age);
    }
    var demo = new Person("刘德华",15);
    var demo1 = new Person("刘德华",15);
    demo.showName();
    alert(demo.showName === demo1.showName);


</script>